﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
  
  <link href="${ctx.resource}/css/shiftform.css" rel="stylesheet">
  <link href="${ctx.resource}/css/select2.css" rel="stylesheet">
  <link href="${ctx.resource}/css/select2-bootstrap.css" rel="stylesheet">
  
  <title></title>

</head>

<body>

  <%@ include file="/WEB-INF/include/header.jsp"%>

  <%@ include file="/WEB-INF/include/menu.jsp"%>

  <div class="container main-content">

    <div class="panel panel-default beast-panel beast-panel-layout">

      <div class="panel-heading">
        <ol class="breadcrumb">
          <li><a href="${ctx.host}/aduser">广告主管理</a></li>
          <li class="active">广告主数据</li>
        </ol>
      </div>

      <div class="panel-body">

        <div class="col-xs-2 beast-panel-layout-left no-horizontal-padding">
          <%@ include file="/WEB-INF/include/submenu.jsp"%>
        </div>

        <div class="col-xs-10 beast-panel-layout-right">

          <div class="beast-breadcrumb-wrapper">
            <div class="beast-breadcrumb clearfix">
              <h2><i class="glyphicon glyphicon-fire" title="广告主数据"></i>&nbsp;&nbsp;<span>广告主数据&nbsp;-&nbsp;广告主详情</span></h2>
            </div>
          </div>
          
          <div class="beast-toolbar-wrapper top-margin-20 clearfix">
            <div class="text-right" style="padding-top: 10px; padding-bottom: 10px; border-bottom: 2px solid #CCC; ">
              <button type="button" class="btn btn-default btn-shadow btn-shadow-default demo2do-btn" onclick="window.location.href='${ctx.host}/adusers'"><i class="glyphicon glyphicon-arrow-left"></i>&nbsp;&nbsp;返回</button>
            </div>	
          </div>
          
          <div class="beast-breadcrumb-wrapper top-margin-20">
            <div class="beast-breadcrumb yellow clearfix">
              <h2>
                <span>基本信息</span>
              </h2>
              <a href="${ctx.host}/adusers/${aduser.id}/profile" data-toggle="modal" data-target="#" style="position: absolute; right: 0px; top: 0px; margin-top: 10px; margin-right: 10px;">编辑</a>
            </div>
          </div> 

          <div class="form-horizontal bottom-margin-20">
            
            <div class="form-group">
              <label class="col-xs-2 control-label">编号：</label>
              <div class="col-xs-4 pull-left"><p class="form-control-static">${ aduser.id }</p></div>
              <label class="col-xs-2 control-label">联系人：</label>
              <div class="col-xs-4 pull-left"><p class="form-control-static">${ aduser.profile.nickName }</p>
              </div>
            </div>
            
            <div class="form-group">
              <label class="col-xs-2 control-label">注册时间：</label>
              <div class="col-xs-4 pull-left"><p class="form-control-static">${aduser.createTime}</p></div>
              <label class="col-xs-2 control-label">注册手机：</label>
              <div class="col-xs-4 pull-left"><p class="form-control-static">${aduser.profile.userName}</p>
              </div>
            </div>
            
            <div class="form-group">
              <label class="col-xs-2 control-label">用户级别：</label>
              <div class="col-xs-4 pull-left"><p class="form-control-static">${aduser.profile.aduserLevel.name}</p></div>
              <label class="col-xs-2 control-label">联系方式：</label>
              <div class="col-xs-4 pull-left"><p class="form-control-static">${aduser.mobile}</p></div>
            </div>

          </div>
          
          <div class="beast-breadcrumb-wrapper top-margin-20">
            <div class="beast-breadcrumb yellow clearfix">
              <h2>
                <span>公司信息</span>
              </h2>
              <a href="${ctx.host}/adusers/${aduser.id}/company" data-toggle="modal" data-target="#" style="position: absolute; right: 0px; top: 0px; margin-top: 10px; margin-right: 10px;">编辑</a>
            </div>
          </div> 
          
          <div class="form-horizontal bottom-margin-20">
            
            <div class="form-group">
              <label class="col-xs-2 control-label">公司全称：</label>
              <div class="col-xs-4 pull-left"><p class="form-control-static">${aduser.company.name}</p></div>
              <label class="col-xs-2 control-label">公司电话：</label>
              <div class="col-xs-4 pull-left"><p class="form-control-static">${aduser.company.phone}</p></div>
            </div>
            
            <div class="form-group">
              <label class="col-xs-2 control-label">企业官网：</label>
              <div class="col-xs-4 pull-left"><p class="form-control-static"><a href="${aduser.company.website}" target="_blank">${aduser.company.website }</a></p></div>
              <label class="col-xs-2 control-label">企业邮箱：</label>
              <div class="col-xs-4 pull-left"><p class="form-control-static">${aduser.company.email}</p></div>
            </div>
            
            <div class="form-group">
              <label class="col-xs-2 control-label">企业QQ：</label>
              <div class="col-xs-4 pull-left"><p class="form-control-static">${aduser.company.qq}</p></div>
              <label class="col-xs-2 control-label">用户职位：</label>
              <div class="col-xs-4 pull-left"><p class="form-control-static">${aduser.company.job}</p></div>
            </div>
            
            <div class="form-group">
              <label class="col-xs-2 control-label">企业地址：</label>
              <div class="col-xs-8 pull-left"><p class="form-control-static">${aduser.company.address}</p></div>
            </div>
            
          </div>
          
          <div class="beast-breadcrumb-wrapper top-margin-20">
            <div class="beast-breadcrumb yellow clearfix">
              <h2>
                <span>财务信息</span>
              </h2>
              <c:if test="${aduser.status.name eq 'AUDITED' }">
                <a href="${ctx.host}/adusers/${aduser.id}/balance" data-toggle="modal" data-target="#" style="position: absolute; right: 0px; top: 0px; margin-top: 10px; margin-right: 10px;">充值</a>
              </c:if>
            </div>
          </div> 
          
          <div class="form-horizontal bottom-margin-20">
            
            <div class="form-group">
              <label class="col-xs-2 control-label">账户余额：</label>
              <div class="col-xs-4 pull-left"><p class="form-control-static text-success">￥&nbsp;<fmt:formatNumber value="${aduser.aduserBalance.balance/100}" pattern="#.##"/>&nbsp;元</p></div>
              <label class="col-xs-2 control-label">消费金额总计：</label>
              <div class="col-xs-4 pull-left"><p class="form-control-static text-warning">￥&nbsp;<fmt:formatNumber value="${aduser.aduserBalance.consumeTotal/100}" pattern="#.##"/>&nbsp;元</p></div>
            </div>
            <div class="form-group">
              <label class="col-xs-2 control-label">充值金额总计：</label>
              <div class="col-xs-4 pull-left"><p class="form-control-static text-danger">￥&nbsp;<fmt:formatNumber value="${aduser.aduserBalance.depositTotal/100}" pattern="#.##"/>&nbsp;元</p></div>
              <label class="col-xs-2 control-label">质检退款总计：</label>
              <div class="col-xs-4 pull-left"><p class="form-control-static text-danger">￥&nbsp;<fmt:formatNumber value="${aduser.aduserBalance.refundTotal/100}" pattern="#.##"/>&nbsp;元</p></div>
            </div>
            
          </div>
          
          <div class="beast-breadcrumb-wrapper top-margin-20">
            <div class="beast-breadcrumb yellow clearfix">
              <h2>
                <span>财务记录</span>
              </h2>
            </div>
          </div> 
          <div class="form-horizontal bottom-margin-20">
            <c:choose>
              <c:when test="${empty  aduserTransactions }">
                <p class="margin text-center">暂无财务记录</p>
              </c:when>
              <c:otherwise>
                <table class="table table-striped table-hover demo2do-table bottom-margin-20">
                  <thead>
                    <tr>
                      <th>消费类型</th>
                      <th>时间</th>
                      <th>金额</th>
                    </tr>
                  </thead>
                  <tbody>
                    <c:forEach var="aduserTransaction" items="${aduserTransactions}">
                    
                    <c:choose>
					   <c:when test="${aduserTransaction.transactionType.description  == '消费'}">
					   	<tr>
						   <td><p>${aduserTransaction.transactionType.description}</p></td>
		                    <td><fmt:formatDate value="${aduserTransaction.createTime}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
                      		<td><p><font class="text-danger">￥&nbsp;-<fmt:formatNumber value="${aduserTransaction.balance/100}" pattern="#.##"/>&nbsp;元</font></p> </td>
	                    </tr>
					   </c:when>
					   <c:otherwise> 
				   		<tr>
						   <td><p>${aduserTransaction.transactionType.description}</p></td>
		                    <td><fmt:formatDate value="${aduserTransaction.createTime}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
                      		<td><p><font color="green">￥&nbsp;<fmt:formatNumber value="${aduserTransaction.balance/100}" pattern="#.##"/>&nbsp;元</font></p> </td>
	                    </tr>
					   </c:otherwise>
					  </c:choose>
					  
                    </c:forEach>
                  </tbody>
                </table>
              </c:otherwise>
            </c:choose>
          </div>
          
        </div>
      </div>

    </div>
  </div>

  <%@ include file="/WEB-INF/include/footer.jsp"%>
  <%@ include file="/WEB-INF/include/script.jsp"%>
  <script src="${ctx.resource}/js/shiftform.js"></script>
  <script src="${ctx.resource}/js/select2.min.js"></script>
  <script src="${ctx.resource}/js/select2_locale_zh-CN.js"></script>
  <script src="${ctx.resource}/js/bootstrap.validate.js"></script>
  <script src="${ctx.resource}/js/bootstrap.validate.en.js"></script>
 
</body>

</html>
